﻿@{
    Layout = "~/Views/Shared/_Behind.cshtml";
    ViewBag.Title = "长月甜品-订单管理";
}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="keywords" content="">
    <meta name="author" content="">
    <meta name="robots" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">


</head>
<body>

    <div id="app" class="content-body" >
        <h3 style="border:20px solid white;background-color:white">所有订单信息</h3>
        <br />
        <div style="margin: 0px auto; width: 80%; display: flex; justify-content: space-between; box-shadow: 1px 1px 2px #eaeaea;">
            <el-input v-model="input" placeholder="请输入查询的商品" style="width:85%;"></el-input>
            <el-button type="primary" v-on:click="Search()" style="width:10%;background-color:black">查询</el-button>
        </div>
        <!-- row -->
        <el-table :data="tableData"
                  style="width: 100%; border: 20px solid white; border-left:2px solid rgb(0 0 0 / 0.09);margin-top:30px;">
            <el-table-column prop="oid"
                             label="编号"
                             width="150">
            </el-table-column>
            <el-table-column prop="uaccount"
                             label="用户名称"
                             width="150">
            </el-table-column>
            <el-table-column prop="pname"
                             label="商品"
                             width="150">

            </el-table-column>
            <el-table-column prop="pimg"
                             label="图片"
                             width="180">
                <template slot-scope="scope">
                    <img :src="Baseimg+scope.row.pimg" width="100" height="100" />
                </template>
            </el-table-column>
            <el-table-column prop="pprice"
                             label="单价"
                             width="120">
            </el-table-column>
            <el-table-column prop="ssize"
                             label="尺寸"
                             width="150">
            </el-table-column>
            <el-table-column prop="quantity"
                             label="数量"
                             width="150">
            </el-table-column>
            <el-table-column label="操作"
                             width="180">
                <template slot-scope="scope">
                    <el-button size="mini"
                               type="danger"
                               v-on:click="handleDelete(scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>


    <script src="~/Scripts/jquery-3.4.1.min.js"></script>
    <script src="~/static/js/vue-2.6.12.js"></script>

    <script src="~/element-ui/index.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script>
        var Main = {
            data() {
                return {
                    tableData: [],
                    Baseimg: "https://tcr-1308226713.cos.ap-guangzhou.myqcloud.com/Images/",
                    input: "",


                }
            },
            created() {
                this.GetAllOrders();

            },
            methods: {
                async GetAllOrders() {
                    const { data: res } = await axios.get("/Admins/GetAllOrders");
                    console.log(res);
                    this.tableData = res;
                },
                //查询
                async Search() {
                    const { data: res } = await axios.post("/Admins/SearchesOrder", { name: this.input });
                    if (res == "无") {
                        alert("暂无此商品！")
                    } else {
                        this.tableData = res;
                    }
                },

            }

        }

        var Ctor = Vue.extend(Main)
        new Ctor().$mount('#app')
    </script>

    <script src="~/behind/js/global.min.js"></script>
    <script src="~/behind/js/jquery.nice-select.min.js"></script>

    <script src="~/behind/js/Chart.bundle.min.js"></script>

    <script src="~/behind/js/owl.carousel.js"></script>
    <script src="~/behind/js/custom.min.js"></script>
    <script src="~/behind/js/dlabnav-init.js"></script>
    @*<script src="~/behind/js/styleSwitcher.js"></script>*@



</body>
</html>
